#include "SerialPort.h"
#include "Windows.h"

namespace MC500
{

class WinSerialPort : public SerialPort
{
public:
    WinSerialPort(const std::string &devName);
    ~WinSerialPort();

    virtual ErrorCode Init(uint32_t speed) override;

    //发送数据
    virtual ErrorCode Send(const uint8_t *data, uint16_t len) override;

    //接受数据
    virtual ErrorCode Read(uint8_t *data, uint16_t buffSize, uint16_t &readCount) override;

private:
    std::string devName_;
    HANDLE comHandle_;    
};

}; // namespace MC500
